import { axios } from '@/utils/request'

const api = {
  roomContent: '/meeting/roomContent'
}

export function getRoomContentList (parameter) {
  return axios({
    url: api.roomContent + '/list',
    method: 'get',
    params: parameter
  })
}

export function get (id) {
  return axios({
    url: api.roomContent + '/get/'+id,
    method: 'get',
    params: {}
  })
}


export function selectSearchInfoByType (parameter) {
  return axios({
    url: api.roomContent + '/searchInfo/1',
    method: 'get',
    params: {}
  })
}

export function selectSearchInfoByCapacity (parameter) {
  return axios({
    url: api.roomContent + '/searchInfo/2',
    method: 'get',
    params: {}
  })
}

export function selectSearchInfoByShape (parameter) {
  return axios({
    url: api.roomContent + '/searchInfo/4',
    method: 'get',
    params: {}
  })
}

export function saveRoomContent (parameter) {
  return axios({
    url: api.roomContent + (parameter.id > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function addRoomServe (parameter) {
  return axios({
    url: api.roomContent + '/addRoomServe',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function addRoomItem (parameter) {
  return axios({
    url: api.roomContent + '/addRoomItem',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

//根据会议室id 获取服务列表
export function selectRoomServeByRoom (parameter) {
  return axios({
    url: api.roomContent + '/selectRoomServeByRoom',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}


export function getFloorList (parameter) {
  return axios({
    url: api.roomContent + '/getFloorList',
    method: 'get',
    params: parameter
  })
}

export function getCustomerList (parameter) {
  return axios({
    url: api.roomContent + '/customerList',
    method: 'get',
    params: parameter
  })
}


export function selectRoomById (parameter) {
  return axios({
    url: api.roomContent + '/selectRoomById',
    method: 'get',
    params: parameter
  })
}


export function getRoomListByFloorId (parameter) {
  return axios({
    url: api.roomContent + '/getRoomListByFloorId',
    method: 'get',
    params: parameter
  })
}

export function getRoomListByBuildIdsRq (parameter) {
  return axios({
    url: api.roomContent + '/getRoomListByBuildIds',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function selectRoomItemByRoom (parameter) {
  return axios({
    url: api.roomContent + '/selectRoomItemByRoom',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}


export function delRoomContent (parameter) {
  return axios({
    url: api.roomContent + '/remove',
    method: 'post',
    params: parameter
  })
}




export const roomContentExport = api.roomContent + '/export'
